package com.igeek.boot.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author fengqq
 * @Description TODO
 * @Date 2024/8/13  10:48
 *
 */
//@Slf4j lombok简化日志开发
@Slf4j
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello(@RequestParam("name") String name){
        try{
            String str = null;
            System.out.println(str.length());
            log.info("你好这是一个重要信息");
        }catch (Exception e){
            e.printStackTrace();
            log.error("这是一个错误信息,{}",name);
        }
        return "Hello，Spring Boot 2";
    }
}
